package com.unique.demo.interceptor;

import javax.servlet.http.HttpServletRequest;

import org.unique.aop.intercept.MethodInvocation;
import org.unique.ioc.annotation.Component;
import org.unique.web.core.WebContext;
import org.unique.web.interceptor.AbstractRouteInterceptor;

@Component
public class BaseInterceptor extends AbstractRouteInterceptor {
	
	@Override
	public Object invoke(MethodInvocation invocation) throws Throwable {
		System.out.println("执行拦截器before1");
		HttpServletRequest req = WebContext.getHttpServletRequest();
		req.setAttribute("base", req.getContextPath());
		Object result = invocation.proceed();
		System.out.println("执行拦截器after1");
		return result;
	}

}
